
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="../favicon.ico"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"><title>NEUSOFT | OA</title><link rel="stylesheet" href="../common.css"><link rel="stylesheet" href="../thirdparty-lib/fontawesome/font-awesome.min.css"><script src="../thirdparty-lib/jquery/jquery.min.js"></script><script src="../common.js"></script>
<style>
</style>
</head>
<body class="layout-vbox">
    <nav>
         <a 
            href="javascript:history.back()"
            class="fa fa-back unmount back"></a>
        <ol class="breadcrumb">
            <li>
                <a
                    href="javascript:window.top.dashboard()"
                    class="fa fa-dashboard">首页 </a>
            </li>
            <li>个人中心</li>
            <li>
                <b>修改密码</b>
            </li>
        </ol>
    </nav>
    <menu>
        <a
            id="submitFormBtn"
            href="javascript:submitForm()"
            class="btn">提交修改</a>
    </menu>

    <form
        id="passwordForm"
        class="label7em"
        >
        <p>
            <label for="oldPasswordEL">*原密码：</label>
            <input
                type="password"
                name="oldPassword"
                class="grow"
                id="oldPasswordEL"
                placeholder="请输入旧密码">
        </p>
        <p>
            <label for="newPasswordEL">*新密码：</label>
            <input
                type="password"
                name="newPassword"
                maxlength="16"
                class="grow"
                id="newPasswordEL"
                placeholder="6-16个字符，必须包含字母，数字，特殊字符">
        </p>
        <p>
            <label for="newPasswordConfirmEL">*新密码确认：</label>
            <input
                type="password"
                name="newPasswordConfirm"
                maxlength="16"
                class="grow"
                id="newPasswordConfirmEL"
                placeholder="请再次输入您的新密码">
        </p>
    </form>
    <script>
    
    var submitForm=function(){
        //防止重复提交
        var submitBtn = $("#submitFormBtn")[0];
        submitBtn.disabled = true;
        $.put("/api/user/modify-password", $("#passwordForm").serialize(), function(resp) {
                window.top.toast("密码修改成功，请重新登陆!");
                setTimeout(function(){
                    window.top.location.href="../login/view.html";    
                },1000)
                
        }).always(function(){
            submitBtn.disabled = false;
        });
    };
</script>
</body>

</html>